package com.happycat.controller.social;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.happycat.base.PageParams;
import com.happycat.base.R;
import com.happycat.social.entity.SocialVoiceRoomCategory;
import com.happycat.social.service.ISocialVoiceRoomCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author shenbin
 * @CreatedDate 2020-09-10
 * @Modified By:
 */
@RestController
@RequestMapping("/social/room/category")
@Api(tags = "API-聊天室-分类管理", value = "聊天室")
public class SocialRoomCategoryController {
    @Autowired
    private ISocialVoiceRoomCategoryService socialVoiceRoomCategoryService;

    @ApiOperation(value = "分类列表-分页")
    @GetMapping(value = "/pageList")
    public R<IPage<SocialVoiceRoomCategory>> pageList(PageParams pageParams){
        return R.success(socialVoiceRoomCategoryService.page(pageParams.buildPage()));
    }

    @ApiOperation(value = "分类列表-all")
    @GetMapping(value = "/getAllList")
    public R<List<SocialVoiceRoomCategory>> getAllList(){
        return R.success(socialVoiceRoomCategoryService.list());
    }
}
